Scenario #1020: Add Representative to Partner

UseCase Add Representative To Partner => Representative: Tracy Trust for Test AG

Properties

Required

Given

name value
partnerPersonTradeName Test AG
representativeFamilyName Trust
representativeGivenName Tracy
representativePostalAddress         “name”: “Michelle Matthieu”,
        “street”: “An der Alster 100”,
        “zipcode”: “20000”,
        “city”: “Hamburg”,
        “country”: “Germany”
representativePhoneNumber +49 40 123456
representativeEMailAddress tracy.trust@example.org

Person: Test AG

HTTP GET "/api/hs/office/persons?name=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "3029ef4b-ab91-429d-855b-26a8bedcef6e", // Person: Test AG
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

Person: Tracy Trust

HTTP POST "/api/hs/office/persons" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "personType" : "NATURAL_PERSON",
  "familyName" : "Trust",
  "givenName" : "Tracy"
}
EOF
=> status: 201 CREATED 4eac01e6-1262-4b3b-b5e6-fdd95495c06d

Please check first if that person already exists, if so, use it’s UUID below.

HINT: A representative is always a natural person and represents a non-natural-person.

Contact: Tracy Trust

HTTP POST "/api/hs/office/contacts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "caption" : "Tracy Trust",
  "postalAddress" : {
    "name" : "Michelle Matthieu",
    "street" : "An der Alster 100",
    "zipcode" : "20000",
    "city" : "Hamburg",
    "country" : "Germany"
  },
  "phoneNumbers" : {
    "main" : "+49 40 123456"
  },
  "emailAddresses" : {
    "main" : "tracy.trust@example.org"
  }
}
EOF
=> status: 201 CREATED 6ea6975a-a506-43d5-bb3c-67b23af7f5b6

Please check first if that contact already exists, if so, use it’s UUID below.

Create Representative: Tracy Trust for Test AG

HTTP POST "/api/hs/office/relations" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "type" : "REPRESENTATIVE",
  "anchor.uuid" : "3029ef4b-ab91-429d-855b-26a8bedcef6e", // Person: Test AG
  "holder.uuid" : "4eac01e6-1262-4b3b-b5e6-fdd95495c06d", // Person: Tracy Trust
  "contact.uuid" : "6ea6975a-a506-43d5-bb3c-67b23af7f5b6" // Contact: Tracy Trust
}
EOF
=> status: 201 CREATED d8347ccc-31bd-4d7b-8e7e-eb9676be75f0

Verify the REPRESENTATIVE Relation Got Removed

HTTP GET "/api/hs/office/relations?relationType=REPRESENTATIVE&personData=Trust" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "d8347ccc-31bd-4d7b-8e7e-eb9676be75f0",
  "anchor" : {
    "uuid" : "3029ef4b-ab91-429d-855b-26a8bedcef6e", // Person: Test AG
    "personType" : "LEGAL_PERSON",
    "tradeName" : "Test AG",
    "salutation" : null,
    "title" : null,
    "givenName" : null,
    "familyName" : null
  },
  "holder" : {
    "uuid" : "4eac01e6-1262-4b3b-b5e6-fdd95495c06d", // Person: Tracy Trust
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Tracy",
    "familyName" : "Trust"
  },
  "type" : "REPRESENTATIVE",
  "mark" : null,
  "contact" : {
    "uuid" : "6ea6975a-a506-43d5-bb3c-67b23af7f5b6", // Contact: Tracy Trust
    "caption" : "Tracy Trust",
    "postalAddress" : {
      "zipcode" : "20000",
      "country" : "Germany",
      "city" : "Hamburg",
      "street" : "An der Alster 100",
      "name" : "Michelle Matthieu"
    },
    "emailAddresses" : {
      "main" : "tracy.trust@example.org"
    },
    "phoneNumbers" : {
      "main" : "+49 40 123456"
    }
  }
} ]

generated on 2026-08-10 03:08:28 for branch HEAD